package org.zhq.controller.center;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.zhq.ServerResult;
import org.zhq.pojo.Users;
import org.zhq.service.center.CenterUsersService;

@Api(value = "用户中心",tags = {"用户中心"})
@RestController
@RequestMapping("center")
public class CenterController {

    private final CenterUsersService centerUsersService;

    @Autowired
    public CenterController(CenterUsersService centerUsersService) {
        this.centerUsersService = centerUsersService;
    }

    @ApiOperation(value = "获取用户信息",notes = "获取用户信息",httpMethod = "GET")
    @GetMapping("/userInfo")
    public ServerResult userInfo(@RequestParam String userId){
        Users users = centerUsersService.queryUsersInfoById(userId);
        return ServerResult.ok(users);
    }
}
